package com.example.xademo.service;

import com.example.xademo.db163.dao.XA163Mapper;
import com.example.xademo.db163.dao.XA163Mapper;
import com.example.xademo.db163.model.XA163;
import com.example.xademo.db164.dao.XA164Mapper;
import com.example.xademo.db164.model.XA164;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class XAService {

    @Resource
    private XA163Mapper xa163Mapper;
    @Resource
    private XA164Mapper xa164Mapper;

    @Transactional(transactionManager = "xaTransaction")
    public void testXA() {
        XA163 xa163 = new XA163();
        xa163.setId(1);
        xa163.setName("xa_163");
        xa163Mapper.insert(xa163);

        XA164 xa164 = new XA164();
        xa164.setId(1);
        xa164.setName("xa_164");
        xa164Mapper.insert(xa164);

    }
}
